{#
    This template defines a data_editor macro that is selected
    within content.py based on the item's content type.
    It will be passed to the modify.html template.

    A specialized applet is used to edit twikidraw items.
#}

{% macro data_editor(form, item_name) %}
    <p>
        <applet code="CH.ifa.draw.twiki.TWikiDraw.class"
                archive="{{ url_for('serve.files', name='twikidraw_moin', filename='twikidraw_moin.jar') }}"
                width="800" height="620">
            <param name="drawpath" value="{{ url_for('frontend.get_item', item_name=item_name, member='drawing.draw') }}" />
            <param name="pngpath"  value="{{ url_for('frontend.get_item', item_name=item_name, member='drawing.png') }}" />
            <param name="savepath" value="{{ url_for('frontend.modify_item', item_name=item_name, contenttype='application/x-twikidraw') }}" />
            <param name="basename" value="drawing" />
            <param name="viewpath" value="{{ url_for('frontend.show_item', item_name=item_name) }}" />
            <param name="helppath" value="" />
            <strong>{{ _("NOTE:") }}</strong> {{ _("You need a Java enabled browser to edit the drawing.") }}
        </applet>
    </p>
    <br />
{% endmacro %}
